﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Gift.DAL;
using Gift.Model;
using System.Data;

namespace WebSite.cn
{
    public partial class Money : BasePage
    {
        readonly MemberAccount theMemberAccount = new MemberAccount();
        readonly Card theCard = new Card();
        readonly Member theMember = new Member();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (base.LoginUserMember == null)
                {
                    base.Response.Write("<script language=javascript>window.location.href='login.aspx';</script>");
                    base.Response.End();
                    return;
                }
                this.BindCardList();
            }
        }
        private void BindCardList()
        {
            DataSet ds;
            if (base.LoginUserMember.IsCard == false)
            {
                ds = theMemberAccount.GetListByMemberId(int.Parse(base.LoginUserMember.MemberId));
                if (ds != null && ds.Tables.Count > 0)
                {
                    this.GridView1.DataSource = ds.Tables[0].DefaultView;
                    this.GridView1.DataBind();
                }
            }
        }

    }
}